package org.xiyu.yee.onekeyminer_chainable_visual.client;

import net.minecraft.client.Minecraft;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.client.event.ClientTickEvent;
import org.xiyu.yee.onekeyminer_chainable_visual.Onekeyminer_chainable_visual;

@EventBusSubscriber(modid = Onekeyminer_chainable_visual.MODID, value = net.neoforged.api.distmarker.Dist.CLIENT)
public class ClientKeyHandler {
    
    @SubscribeEvent
    public static void onClientTick(ClientTickEvent.Post event) {
        // 检查是否按下了配置按键
        if (KeyBindings.wasOpenConfigKeyPressed()) {
            Minecraft mc = Minecraft.getInstance();
            if (mc.screen == null) { // 只有在没有其他GUI打开时才打开配置屏幕
                mc.setScreen(new ModernConfigScreen(null));
            }
        }
    }
}